import { computed } from 'vue'
import store from '@/store'
const permissions = computed(() => store.state.client.permissions)
export function setupPermissionDirective(app) {
  app.directive('permission', {
    mounted(el, binding) {
      if (!permissions.value.find(permission => permission.auth === binding.value)) {
        el.parentElement.removeChild(el)
      }
    }
  })
}
